#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>

void bubble(int* arr,int lenth)
{
	while(--lenth)
	{
		int i = 0;
		for (; i < lenth; i++)
		{
			if (arr[i] > arr[i + 1])
			{
				int temp = arr[i];
				arr[i] = arr[i + 1];
				arr[i + 1] = temp;
			}
		}
	}
}



int main()
{
	int arr[] = { 7,4,5,9,8,2,1 };
	bubble(arr,7);
	for (int i = 0; i < 7; i++)
		printf("%d", arr[i]);
	return 0;
}




	
